{include file="/public/header" /}
{include file="/public/navbar" /}
<style type="text/css">
.table tr,.table th {
    border: 1px solid #e2e2e2;
    height: 24px;
    line-height:24px !important;
}
tr:nth-child(odd) {
    background-color: #FAFAFA; /* 浅灰色背景 */
}
/* 偶数行（实际上是未选中的奇数行，因为我们会高亮选中的行） */
tr:nth-child(even) {
}
</style>
<div class="container">
    <div class="page form_page js_show" tabindex="-1">
        <form name="form" method="post" class="weui-form" style="padding-top:20px;width:100%;">
            <div class="weui-form__control-area" style="margin-top:0;">
                <div class="weui-cells__group weui-cells__group_form">
                    <div class="weui-cells">
                        <div id="js_cell_vcode" class="weui-cell weui-cell_active weui-cell_vcode weui-cell_wrap">
                            <div class="weui-cell__hd"><label for="js_input2" class="weui-label">结算日期</label></div>
                            <div class="weui-cell__bd weui-flex">
                              <input class="weui-input weui-cell__control weui-cell__control_flex" type="text" name="fday" value="{$fday ?? ''}" placeholder="请选择日期" maxlength="10" readonly />
                              <button id="js_input_clear" class="weui-btn_reset weui-btn_icon weui-btn_input-clear">
                                <i class="weui-icon-clear"></i>
                              </button>
                              <button role="button" onclick="return Sys.DForm(this);" class="js_target weui-cell__control weui-btn weui-btn_default weui-vcode-btn">查询</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--{if ($b['rows'] ?? NULL)}-->
            <div style="padding:0 5px;">
            <table class="table" width="100%" border="0" cellspacing="0" cellpadding="0">
                <thead>
                  <th class="table_tit">门店名称</th>
                  <th>签到统计(元)</th>
                  <th>员工缴费(元)</th>
                </thead>
                <!--{foreach $b['rows'] as $key => $row}-->
                <tr>
                  <td>{$row['title'] ?? ''}</td>
                  <td>{$row['kamount'] ?? ''}</td>
                  <td>{$row['pamount'] ?? ''}</td>
                </tr>
                <!--{/foreach}-->
              </table>
              </div>
              <!--{/if}-->
        </form>
    </div>
</div>
<script type="text/javascript">
Sys.DForm = function(o){
    let form = $(o).parents('form');
    let p = {
        'fday'   : form.find('input[name="fday"]').val(),
    }
    if (!Sys.rule('datetime',p['fday'])) {
        weui.topTips('请选择结算日期',1500);return false;
    }
    form.submit();
    return true;
}

$(document).ready(function (){
    $(':text[name="fday"]').on('click', function () {
        weui.datePicker({
            start: 1990,
            end: new Date().getFullYear(),
            onChange: function (result) {
                console.log(result);
            },
            onConfirm: function (result) {
                $(':text[name="fday"]').val(result.join('-'));
                console.log(result);
            },
            title: '日期选择'
        });
    });
});
</script>
{include file="/public/footer" /}